﻿
namespace SkillSystem
{
    /// <summary>
    /// 触发的处理器，检测触发的时机、次数
    /// </summary>
    public class SkillTriggerProcesser : SkillItemProcesserBase
    {
        TransmitterBase _transmitter;
        bool isFirstTrigered=true;
        ComboSkillItemLinker _linker;
        public SkillTriggerProcesser(TransmitterBase transmitter)
        {
            _transmitter = transmitter;
        }

        public override void Break()
        {

        }

        public override void Do()
        {
            _linker = (ComboSkillItemLinker)_transmitter.CurSkillItem.Linkers[SkillItemLinkerType.Combo];
            if (isFirstTrigered)
            {
                isFirstTrigered = false;
                _linker.HitCount= - 1;
            }
            _linker.HitCount++;
        }

        public override void OnSkillCompleted()
        {

            isFirstTrigered = true;
        }
    }
}